package com.panshi.controller;

import com.panshi.entity.SysAdminT;
import com.panshi.service.SysClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
public class AdminIndexController {

    @Autowired
    private SysClientService sysClientService;



    @GetMapping("/welcome")
    public String welcome(HttpServletRequest request, Model model) {
        String id = request.getParameter("id");
        System.out.println("首页初始化"+id);
        SysAdminT adminApi = sysClientService.getAdminById(Integer.valueOf(id));
        model.addAttribute("adminApi",adminApi);

        return "welcome";
    }

    @GetMapping(value = {"/index","/"})
    public String index(){

        return "index";
    }


}
